using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public abstract class Singleton<T> : MonoBehaviour where T:Component
{
    [SerializeField] protected bool isPersistence;

    private static T _instance;

    public static T Instance
    {
        get => _instance;
    }

    protected virtual void Awake()
    {
        if(_instance == null)
            _instance = this as T;
        else
            Destroy(gameObject);
    }
}
